#coding=utf-8

class Base(object):

    home = 'liuyulin_home'
    __home_name = 'beautiful heart'
    def __init__(self,name,age,sex):
        '''
        初始化
        '''
        self.name = name
        self.__age = age
        self.sex = sex

    @property
    def age(self):
        return self.__age

    @age.setter
    def age(self, value):
        self.__age = value

    # @age.deltter
    # def age(self):
    #     del self.__age

    @classmethod
    def home_name(cls):
        return cls.__home_name

    @staticmethod
    def sayhello(hello):
        return 'you say that "%s"'%hello



    def __getattr__(self, item):
        return self.item

    def __str__(self):
        print "name is %s, and age is %d, and sex is %s"%(self.name, self.__age, self.sex)

    def __repr__(self):
        print "name is {}, and age is {}, and sex is {}".format(self.name,self.__age,self.sex)


class ParentMessage(Base):

    def __init__(self, name, age, sex, relationship):
        """
        我爸爸妈妈的信息
        :return:
        """
        self.relationship = relationship
        super(ParentMessage,self).__init__(name, age, sex)
        print 'mother or father name is %s, age is %d'%(self.name, self.age)






liuchangke = Base('liuchangke',27,'1')
print liuchangke.name
print liuchangke.age
liuchangke.age = '26'
print liuchangke.age
# del liuchangke.age
print liuchangke.age
# print liuchangke.Base.__getattr__(age)
print liuchangke.home_name()
print Base.home_name()
print liuchangke.sayhello('wo jiu bushuo hello')

mama = ParentMessage('mama',60,'女','非常好')

